// 获取文章详情
import request from '@/utils/request'
export const getDetailAPI = (article_id) => {
  return request({
    url: `/v1_0/articles/${article_id}`
  })
}
//收藏文章
export const getCollection = (target) => {
  return request({
    method: 'POST',
    url: '/v1_0/article/collections',
    data: {
      target
    }
  })
}
//取消收藏文章
export const NotCollection = (target) => {
  return request({
    method: 'DELETE',
    url: `/v1_0/article/collections/${target}`
  })
}
//评论文章
export const commentsArticle = (data) => {
  return request({
    method: 'POST',
    url: '/v1_0/comments',
    data
  })
}
//获取评论列表
export const getCommentAPI = (params) => {
  return request({
    url: '/v1_0/comments',
    params
  })
}
//取消点赞
export const notlikeArticleAPI = (target) => {
  return request({
    method: 'DELETE',
    url: `/v1_0/comment/likings/${target}`
  })
}
//点赞
export const likeArticleAPI = (target) => {
  return request({
    method: 'POST',
    url: '/v1_0/comment/likings',
    data: {
      target
    }
  })
}